The following variables can be defined in a project file; some can also be defined in lisp variables.
To set a project variable that is a list, specify each element of the list on a separate line in the project file.
Any project variable can be referenced in other project
variables, using a shell-like notation. For instance, if the
variable comp_cmd contains ${comp_opt},
the value of the comp_opt variable will be
substituted when comp_cmd is used.
In addition, process environment variables can be referenced
using the same syntax, or the normal $var
syntax.
Most project variables have defaults that can be changed by setting lisp variables; the table below identifies the lisp variable for each project variable. Lisp variables corresponding to project variables that are lists are lisp lists.
In general, project variables are evaluated when referenced in
Emacs Ada mode commands. Relative file paths are expanded to
absolute relative to ${build_dir}.
Here is the list of variables. In the default values, the
current directory "." is the project file
directory.
ada_project_path_sep [default: ":" or
";"]ADA_PROJECT_PATH. It defaults
to the correct value for a native implementation of GNAT for
the current operating system. The user must override this
when using Windows native GNAT with Cygwin Emacs, and perhaps
in other cases.
Lisp variable:
ada-prj-ada-project-path-sep.
ada_project_path [default:
""]If set, the ADA_PROJECT_PATH process
environment variable is set to this value in the Emacs
process when the Emacs Ada mode project is selected via menu
‘Ada | Project |
Load’.
For ada_project_path, relative file paths are
expanded to absolute when the Emacs Ada project file is read,
rather than when the project file is selected.
For example if the project file is in the directory
/home/myproject, the
environment variable GDS_ROOT is set to
/home/shared, and the project file contains:
ada_project_path_sep=:
ada_project_path=$GDS_ROOT/makerules
ada_project_path=../opentoken
the environment variable ADA_PROJECT_PATH
will be set to
"/home/shared/makerules:/home/opentoken/".
The default value is not the current value of this environment variable, because that will typically have been set by another project, and will therefore be incorrect for this project.
If you have the environment variable set correctly for all
of your projects, you do not need to set this project
variable.
bind_opt [default: ""]Lisp variable:
ada-prj-default-bind-opt.
build_dir [default: "."]casing [default:
("~/.emacs_case_exceptions")ada-case-exception-file for more info.
Lisp variable:
ada-case-exception-file.
check_cmd [default:
"${cross_prefix}gnatmake -u -c -gnatc ${gnatmake_opt}
${full_current} -cargs ${comp_opt}"]full_current.
Lisp variable:
ada-prj-default-check-cmd
comp_cmd [default:
"${cross_prefix}gnatmake -u -c ${gnatmake_opt}
${full_current} -cargs ${comp_opt}"]full_current.
Lisp variable:
ada-prj-default-comp-cmd.
comp_opt [default: "-gnatq
-gnatQ"]If source code for the project is in multiple directories, the appropriate compiler options must be added here. Set source search path for examples of this. Alternately, GNAT project files may be used; Use GNAT project file.
Lisp variable:
ada-prj-default-comp-opt.
cross_prefix [default: ""]debug_cmd [default: "${cross_prefix}gdb
${main}"]Lisp variable:
ada-prj-default-debugger.
debug_post_cmd [default: ""]debug_cmd.debug_pre_cmd [default: "cd
${build_dir}"]debug_cmd.gnatfind_opt [default:
"-rf"]Lisp variable:
ada-prj-gnatfind-switches.
gnatmake_opt [default: "-g"]Lisp variable:
ada-prj-default-gnatmake-opt.
gpr_file [default: ""]If set, the source and object directories specified in the
GNAT project file are appended to src_dir and
obj_dir. This allows specifying Ada source
directories with a GNAT project file, and other source
directories with the Emacs project file.
In addition, -P{gpr_file} is added to the
project variable gnatmake_opt whenever it is
referenced. With the default project variables, this passes
the project file to all gnatmake commands.
Lisp variable: ada-prj-default-gpr-file.
link_opt [default: ""]Lisp variable:
ada-prj-default-link-opt.
main [default: current file]make_cmd [default:
"${cross_prefix}gnatmake -o ${main} ${main}
${gnatmake_opt} -cargs ${comp_opt} -bargs ${bind_opt} -largs
${link_opt}"]Lisp variable:
ada-prj-default-make-cmd.
obj_dir [default: "."]The compiler commands must place the
‘.ali’
files in one of these directories; the default commands do
that.
remote_machine [default: ""]run_cmd [default:
"./${main}"]src_dir [default: "."]